<template>
  <div>
    <h3>我创建的歌单</h3>
    {{ sing }}
    <table style="width:500px;margin:0 auto">
        <tr>
            <th>编号</th>
            <th>分类</th>
        </tr>
        <tr v-for="(item,i) in sing" :key="i">
            <td>{{ item.id }}</td>
            <td>
                <el-link @click="tiao">{{ item.gedan }}</el-link>
            </td>
        </tr>
    </table>
  </div>
</template>

<script>
import axios from 'axios'
export default {
    data(){
        return{
            sing:[]
        }
    },
    mounted(){
        this.getSing()
    },
    methods:{
        tiao(){
            this.$router.push('/gedanD')
        },
        getSing(){
            axios.get('http://127.0.0.1:8000/user/sing/')
            .then(resp=>{
                console.log(resp);
                this.sing=resp.data
            })
            .catch(resp=>{
                console.log(err);
            })
            
            
        }
    }
}
</script>

<style>

</style>